﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class FrameSpirit : MonoBehaviour
{
    public int speed;
    public Sprite[] spirit;
    public Image image;
    int index;
    // Use this for initialization
    void Start()
    {
        image = GetComponent<Image>();
    }

    // Update is called once per frame
    void Update()
    {
        index = (int)(Time.time * speed) % spirit.Length;
        image.sprite = spirit[index];
    }
}